package com.boost.tjvm.oom;

import java.util.ArrayList;
import java.util.List;

/**
 * java 堆内存溢出
 */
public class HeapOOM {

    static class OOMObject{}

    public static void main(String [] args){
        //-Xms20m -Xmx20m -XX:+HeapDumpOnOutOfMemoryError
        List<OOMObject> list = new ArrayList<>();
        while (true){
            list.add(new OOMObject());
        }
    }
}
